package d0320;

import java.io.*;

public class FileWithDataOutputStream {
    public static void main(String[] args) {
        FileOutputStream fos = null;
        DataOutputStream dos = null;
        File file = new File("src/d0320/data.bin");
        try {
            fos = new FileOutputStream(file);
            dos = new DataOutputStream(fos);
            dos.writeInt(100);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (null!=dos);
            try {
                dos.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        if (null!=fos);
        try {
            fos.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    }
